package com.example.demo.test;

import com.example.demo.bean.User;
import com.example.demo.dao.UserDao;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
public class Usertest {
    @Autowired
    UserDao userDao;
    @Test
    public void test1(){
        User userById = userDao.getUserById(1);
        userById.toString();
        User use1=new User();
        use1.setId(2);
        use1.setUsername("张三");
        use1.setPassword("<PASSWORD>");
        use1.setEmail("test@example.com");
        userDao.addUser(use1);
        System.out.println("添加成功");
    }
}
